package soundwave.com.demo.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import soundwave.com.demo.R;

/**
 * Created by xu on 2017/4/5.
 */

public class Modify_password2 extends Activity  {
    private TextView back;
    private EditText password;
    private Button modify_password;
    private String password_new;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.modify_password2);
        initView();
        modify_password.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                password_new=password.getText().toString();
                if (password_new.equals("")){
                    Toast.makeText(Modify_password2.this, "新密码不能为空", Toast.LENGTH_SHORT).show();
                }else if (password_new.length()<6){
                    Toast.makeText(Modify_password2.this, "新密码不能少于6位", Toast.LENGTH_SHORT).show();
                }else {
                    Toast.makeText(Modify_password2.this, "修改成功", Toast.LENGTH_SHORT).show();
                    finish();

                }
            }
        });

        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });


    }

    private void initView() {
        back = (TextView) findViewById(R.id.back);
        password = (EditText) findViewById(R.id.password);
        modify_password = (Button) findViewById(R.id.modify_password);


    }




    }

